package views;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JPanel;

import presenters.PersonInfoPresenter;


public class PersonInfoPanel extends JPanel {
	private PersonInfoPresenter myPresenter;
	private PaymentInfoPanel payPanel;
	private PersonalInfoPanel panel_1;
	private PlanChoosePanel panel_2;
	private JButton btnDone;
	
	/**
	 * Create the panel.
	 */
	public PersonInfoPanel() {
		setLayout(new BorderLayout(0, 0));
		
		payPanel = new PaymentInfoPanel();
		add(payPanel, BorderLayout.EAST);
		
		panel_1 = new PersonalInfoPanel();
		add(panel_1, BorderLayout.CENTER);
		
		panel_2 = new PlanChoosePanel();
		add(panel_2, BorderLayout.SOUTH);
		
		btnDone = new JButton("DONE");
		add(btnDone, BorderLayout.NORTH);
		btnDone.addActionListener(new MyActionListener());
		

		myPresenter = new PersonInfoPresenter(this, payPanel, panel_1, panel_2);
	}
	
	public PersonInfoPresenter getMyPresenter() {
		return myPresenter;
	}

	
	private class MyActionListener implements ActionListener {

		@Override
		public void actionPerformed(ActionEvent ae) {
			// TODO Auto-generated method stub
			
			myPresenter.process();
		}
		
	}
}
